<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>淘宝轮播图做法</title>
</head>
<style>
    * {
        margin: 0;
        padding: 0;
    }

    li {
        list-style: none;
    }

    .tb-promo {
        position: relative;
        width: 520px;
        height: 280px;
        background-color: yellow;
        margin: 100px auto;
    }

    .tb-promo img {
        width: 520px;
        height: 280px;
    }

    .tb-promo .prev,
    .tb-promo .next {
        position: absolute;
        top: 50%;
        margin-top: -15px;
        /* 加了绝对定位的盒子可以直接设置高度和宽度 */
        width: 20px;
        height: 30px;
        background: rgba(0, 0, 0, .3);
        text-align: center;
        line-height: 30px;
        color: #fff;
        text-decoration: none;
    }

    .tb-promo .prev {
        /* 如果一个盒子既有left属性也有right属性，则默认会执行left属性，同理 top bottom 会执行top */
        left: 0;
        /* 决定定位的盒子垂直居中 */
        /* border-radius 15px; */
        border-top-right-radius: 15px;
        border-bottom-right-radius: 15px;
    }

    .tb-promo .next {
        right: 0;
        /* 决定定位的盒子垂直居中 */
        /* border-radius 15px; */
        border-top-left-radius: 15px;
        border-bottom-left-radius: 15px;
    }

    .promo-nav {
        position: absolute;
        left: 50%;
        margin-left: -35px;
        bottom: 15px;
        width: 70px;
        height: 13px;
        background: rgba(255, 255, 255, .3);
        border-radius: 7px;
    }

    .promo-nav li {
        float: left;
        margin: 3px;
        width: 8px;
        height: 8px;
        background-color: #fff;
        border-radius: 5px;
    }

    .promo-nav .selected {
        background-color: #ff5000;
    }
</style>

<body>
    <div class="tb-promo">
        <img src="images/tb.jpg">
        <!-- left button -->
        <a href="#" class="prev"> &lt; </a>
        <a href="#" class="next"> &gt; </a>
        <ul class="promo-nav">
            <li class="selected"></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
        </ul>
    </div>
</body>

</html>